/*
 * PartialMap.java
 *
 * Created on November 10, 2005, 7:29 PM
 *
 * To change this basis, choose Tools | Options and locate the basis under
 * the Source Creation and Management node. Right-click the basis and choose
 * Open. You can then make changes to the basis in the Source Editor.
 */

package com.xucia.jsponic.data;

import java.security.acl.Acl;
import java.util.List;
import java.util.Set;

import org.mozilla.javascript.Scriptable;


/**
 * This is interface that all persistable objects should implement
 * @author Kris Zyp
 */
public interface Persistable extends Scriptable{
	/**
	 * Gets a field without using JS getters
	 * @param key
	 * @return
	 */
    Object get(String key);
	/**
	 * Sets a value into a field persistently (even it has been declared persistent in the structure) without using JS setters
	 * @param key
	 * @return
	 */
    Object set(String name, Object value);
    /**
     * Returns all the property names for this object that are <b>not</b> inherited.
     * @return
     */
    public Set<String> keySet();
    /**
     * Gets the id of this object
     * @return
     */
    public ObjectId getId();
    /**
     * Get the access level of the object
     * @return
     */
    public int getAccessLevel();
    /**
     * Gets the ACL that defines the access level of this object
     * @return
     */
    Acl getAcl();
    /**
     * Returns all the schemas that apply to this object
     * @return
     */
    public List<Persistable> getSchemas();

}
